package cn.bgw;

public class StringEqualTest {

    public static void main(String[] args) {
        String s1 = "Programming";
        String s2 = "Programming";

        String s3 = "Program";
        String s4 = "ming";
        String s5 = "Program" + "ming";
        String s6 = s3 + s4;

        System.out.println(s1 == s2); // false;
        System.out.println(s1 == s5); // true;
        System.out.println(s1 == s6); // false;
        System.out.println(s1 == s6.intern()); // true;
        System.out.println(s1 == s2.intern()); // true;

        System.out.println(testReturn());

    }

    public static int testReturn() {
        try {
            return 1;
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return 2;
        }
    }
}
